home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / f90 / pxfcreat.z / pxfcreat
Encoding:
Text File  |  2002-10-03  |  5.7 KB  |  114 lines

  1. PXFCREAT(3F)                                          Last changed: 1-22-99
  2.  
  3.  
  4. NNAAMMEE
  5.      PPXXFFCCRREEAATT - Creates a new file or rewrites an existing file
  6.  
  7. SSYYNNOOPPSSIISS
  8.      CCHHAARRAACCTTEERR*_n _p_a_t_h
  9.      IINNTTEEGGEERR _i_l_e_n,, _i_m_o_d_e,, _i_f_i_l_d_e_s,, _i_e_r_r_o_r
  10.      CCAALLLL PPXXFFCCRREEAATT((_p_a_t_h,, _i_l_e_n,, _i_m_o_d_e,, _i_f_i_l_d_e_s,, _i_e_r_r_o_r))
  11.  
  12. IIMMPPLLEEMMEENNTTAATTIIOONN
  13.      UNICOS, UNICOS/mk, and IRIX systems
  14.  
  15. SSTTAANNDDAARRDDSS
  16.      IEEE standard interface for FORTRAN 77
  17.  
  18. DDEESSCCRRIIPPTTIIOONN
  19.      On IRIX systems, this routine is in lliibbffoorrttrraann..ssoo which is linked by
  20.      default when compiling programs with the MIPSpro 7 Fortran 90 compiler
  21.      or when compiling programs with the --ccrraayylliibbss option to the MIPSpro
  22.      F77 compiler.
  23.  
  24.      The PPXXFFCCRREEAATT subroutine uses the ccrreeaatt(2) system call to create a new
  25.      file or rewrite an existing file.  The call is similar to PPXXFFOOPPEENN with
  26.      an _i_o_p_e_n_f_l_a_g argument of OO__WWRROONNLLYY, OO__CCRREEAATT, and OO__TTRRUUNNCC.
  27.  
  28.      The value of _i_m_o_d_e indicates specific file modes.  If the file exists,
  29.      _i_m_o_d_e is ignored.  The mode values are used when _p_a_t_h is a new file.
  30.  
  31.      When using the CF90 compiler or MIPSpro 7 Fortran 90 compiler on
  32.      UNICOS, UNICOS/mk, or IRIX systems, all arguments must be of default
  33.      kind unless documented otherwise.  On UNICOS and UNICOS/mk, default
  34.      kind is KKIINNDD==88 for integer, real, complex, and logical arguments; on
  35.      IRIX, the default kind is KKIINNDD==44.
  36.  
  37.      The following is a list of valid arguments for this subroutine:
  38.  
  39.      _p_a_t_h      An input character variable or array element containing the
  40.                name of a file.
  41.  
  42.      _i_l_e_n      An input integer variable containing the length of _p_a_t_h in
  43.                characters.  If _i_l_e_n is zero, all trailing blanks are
  44.                removed before calling ccrreeaatt().
  45.  
  46.      _i_m_o_d_e     An input integer variable containing the integer value of
  47.                the symbolic constant for one or more of the following file
  48.                modes:
  49.  
  50.                UUSSEERR      RREEAADD permissions bit:  SS__IIRRUUSSRR
  51.                          WWRRIITTEE permissions bit:  SS__IIWWUUSSRR
  52.                          SSEEAARRCCHH//EEXXEECCUUTTEE permissions bit:  SS__IIXXUUSSRR
  53.                          Inclusive OORR of RREEAADD//WWRRIITTEE//EEXXEECCUUTTEE:  SS__IIRRWWXXUU
  54.  
  55.                GGRROOUUPP     RREEAADD permissions bit:  SS__IIRRGGRRPP
  56.                          WWRRIITTEE permissions bit:  SS__IIWWGGRRPP
  57.                          SSEEAARRCCHH//EEXXEECCUUTTEE permissions bit:  SS__IIXXGGRRPP
  58.                          Inclusive OORR of RREEAADD//WWRRIITTEE//EEXXEECCUUTTEE:  SS__IIRRWWXXGG
  59.  
  60.                OOTTHHEERR     RREEAADD permissions bit:  SS__IIRROOTTHH
  61.                          WWRRIITTEE permissions bit:  SS__IIWWOOTTHH
  62.                          SSEEAARRCCHH//EEXXEECCUUTTEE permissions bit:  SS__IIXXOOTTHH
  63.                          Inclusive OORR of RREEAADD//WWRRIITTEE//EEXXEECCUUTTEE:  SS__IIRRWWXXOO
  64.  
  65.                SSEETTIIDD     Set user IIDD on execution:  SS__IISSUUIIDD
  66.                          Set group IIDD on execution:  SS__IISSGGIIDD
  67.  
  68.                An integer value for each of these symbolic constants is
  69.                retrieved through the use of PPXXFFCCOONNSSTT or IIPPXXFFCCOONNSSTT.  The
  70.                integer values may be combined through the use of a bitwise
  71.                inclusive OORR function.
  72.  
  73.      _i_f_i_l_d_e_s   An output integer variable containing the file descriptor
  74.                returned by ccrreeaatt().
  75.  
  76.      _i_e_r_r_o_r    An output integer variable that contains zero if the file is
  77.                created or rewritten or nonzero if PPXXFFCCRREEAATT is not
  78.                successful.
  79.  
  80.      In addition to the errors returned by the ccrreeaatt(2) system call,
  81.      PPXXFFCCRREEAATT may return the following errors:
  82.  
  83.      EEIINNVVAALL    If _i_l_e_n < 0 or _i_l_e_n > LLEENN((_p_a_t_h))
  84.  
  85.      EENNOOMMEEMM    If PPXXFFCCRREEAATT is unable to obtain memory to copy _p_a_t_h
  86.  
  87. EEXXAAMMPPLLEESS
  88.           program test
  89.           character*(12) path
  90.           integer ilen, imod, ifilde, ierr
  91.           integer imodru, imodwu, imodwg, imodrg
  92.           integer ierr1, ierr2, ierr3, ierr4
  93.           path = 'testfile'
  94.           imod = 0
  95.           ilen = 0
  96.           call pxfconst('S_IRUSR',imodru,ierr1)
  97.           call pxfconst('S_IWUSR',imodwu,ierr2)
  98.           call pxfconst('S_IRGRP',imodrg,ierr3)
  99.           call pxfconst('S_IWGRP',imodwg,ierr4)
  100.           imod = IOR((IOR(imodru,imodwu)),(IOR(imodrg,imodwg)))
  101.           call pxfcreat(path,ilen,imod,ifilde,ierr)
  102.           if (ierr.ne.0) then
  103.              print *,'FAIL: error from pxfcreat = ',ierr
  104.           else
  105.              print *,'PASS: No error from pxfcreat = '
  106.           endif
  107.           end
  108.  
  109. SSEEEE AALLSSOO
  110.      ccrreeaatt(2), PPXXFFCCOONNSSTT(3F)
  111.  
  112.      _A_p_p_l_i_c_a_t_i_o_n _P_r_o_g_r_a_m_m_e_r'_s _L_i_b_r_a_r_y _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l for the printed
  113.      version of this man page.
  114.